/*  拦截器： yjj   */

package com.woniuxy.main.realm;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter;

public class Out extends AccessControlFilter  {

	@Override
	protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
			throws Exception {
		Subject subject = SecurityUtils.getSubject();
        if(null != subject){
            if(subject.isRemembered()){
                return Boolean.TRUE;
            }
            if(subject.isAuthenticated()){
                return Boolean.TRUE;
            }
        }
		return Boolean.FALSE;
	}

	
	@Override
	protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {	
		return false;
	}

	
}
